<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>使用前必读管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/3.4.1/css/bootstrap.css}">
    <script th:src="@{/webjars/jquery/3.5.1/dist/jquery.js}"></script>
    <script th:src="@{/webjars/bootstrap/3.4.1/js/bootstrap.js}"></script>
    <!-- Font Awesome -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- Ionicons -->
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
    <!-- Theme style -->
    <link href="/static/css/AdminLTE.min.css" rel="stylesheet">
    <link href="/static/css/skins/skin-blue.min.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <!-- Main Header -->
    <header class="main-header">

        <!-- Logo -->
        <a class="logo" href="#">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>C</b>C</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>Child</b>Care</span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a class="sidebar-toggle" data-toggle="offcanvas" href="#" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <!-- The user image in the navbar-->
                            <img alt="User Image" class="user-image" src="/static/img/user2-160x160.jpg">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs" th:text="${session.admin_user}"></span>

                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img alt="User Image" class="img-circle" src="/static/img/user2-160x160.jpg">
                                <p>
                                    admin
                                    <small>管理员就是你爹，想想清楚再和你爹说话</small>
                                </p>
                            </li>
                            <!-- Menu Body -->
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a class="btn btn-default btn-flat" href="#">资料</a>
                                </div>
                                <div class="pull-right">
                                    <a class="btn btn-default btn-flat" href="/login/adminLogout">登出</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">

        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <!-- Sidebar user panel (optional) -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img alt="User Image" class="img-circle" src="/static/img/user2-160x160.jpg">
                </div>
                <div class="pull-left info">
                    <!-- Status -->
                    <p th:text="${session.admin_user}"></p>
                    <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                </div>
            </div>
            <!-- Sidebar Menu -->
            <ul class="sidebar-menu">
                <li class="header">菜单</li>
                <!-- Optionally, you can add icons to the links -->
                <li><a th:href="@{/admin/backToAdmin}"><i class="fa fa-home"></i> <span>首页</span></a></li>
                <li><a th:href="@{/admin/getSensorInfo}"><i class="fa fa-heartbeat"></i> <span>用户传感器信息管理</span></a></li>
                <li><a th:href="@{/admin/listUserInfo}"><i class="fa fa-user"></i> <span>用户信息管理</span></a></li>
                <li><a th:href="@{/admin/listAdminInfo}"><i class="fa fa-user-plus"></i> <span>管理员信息管理</span></a></li>
                <li class="active"><a th:href="@{/admin/listSysInfo}"><i class="fa fa-file-word-o"></i>
                    <span>使用前必读版本控制</span></a></li>
            </ul>
            <!-- /.sidebar-menu -->
        </section>
        <!-- /.sidebar -->

    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                使用前必读信息管理
                <small>Sys Info Management</small>
            </h1>
            <ol class="breadcrumb">
                <li><a th:href="@{/admin/backToAdmin}"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li class="active">使用前必读信息列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <div class="callout callout-info">
                <h4>Tip!</h4>
                <p>这里是使用前必读管理界面~</p>
            </div>

            <div class="row">
                <div class="col-sm-12">
                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <h4 class="box-title">操作</h4>
                        </div>
                        <div class="box-body">
                            <!-- the events -->
                            <div id="external-events">
                                <button class="btn bg-navy margin" data-target="#addModal" data-toggle="modal"
                                        type="button">增加
                                </button>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /. box -->
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="row"></div>
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">使用前必读信息列表</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="dataTables_wrapper form-inline dt-bootstrap" id="example2_wrapper">
                                <div class="row">
                                    <div class="col-sm-6"></div>
                                    <div class="col-sm-6"></div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12">
                                        <table aria-describedby="example2_info"
                                               class="table table-bordered table-hover dataTable"
                                               id="example2" role="grid">
                                            <thead>
                                            <tr role="row">
                                                <th aria-controls="example2"
                                                    aria-label="Rendering engine: activate to sort column descending"
                                                    aria-sort="ascending"
                                                    class="sorting_asc" colspan="1" rowspan="1"
                                                    tabindex="0">
                                                    启用选择
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Rendering engine: activate to sort column descending"
                                                    aria-sort="ascending"
                                                    class="sorting_asc" colspan="1" rowspan="1"
                                                    tabindex="0">
                                                    版本id
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Browser: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1" tabindex="0">
                                                    声明内容
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Platform(s): activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">
                                                    是否启用
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="CSS grade: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">修改
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="CSS grade: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">删除
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr role="row" th:each="sysInfo:${sysInfos}">
                                                <td>
                                                    <a class="btn btn-block bg-aqua-gradient btn-xs"
                                                       th:href="@{/admin/updateAvailableStatus/{id}(id=${sysInfo.getId()})}"
                                                       type="button">启用</a></td>
                                                <td class="sorting_1" th:text="${sysInfo.getId()}"></td>
                                                <td th:text="${sysInfo.getNoteOfDutyFree()}"></td>
                                                <td th:text="${sysInfo.getNoteOf2()}"></td>
                                                <td>
                                                    <a class="btn btn-block bg-maroon btn-xs" data-toggle="modal"
                                                       th:data-target="'#updateModal' + ${sysInfo.getId()}"
                                                       type="button">修改</a>
                                                </td>
                                                <td>
                                                    <a class="btn btn-block bg-orange btn-xs" data-toggle="modal"
                                                       th:data-target="'#removeModal' + ${sysInfo.getId()}"
                                                       type="button">删除</a>
                                                </td>
                                            </tr>
                                            </tbody>
                                            <tfoot>
                                            <tr>
                                                <th aria-controls="example2"
                                                    aria-label="Rendering engine: activate to sort column descending"
                                                    aria-sort="ascending"
                                                    class="sorting_asc" colspan="1" rowspan="1"
                                                    tabindex="0">
                                                    启用选择
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Rendering engine: activate to sort column descending"
                                                    aria-sort="ascending"
                                                    class="sorting_asc" colspan="1" rowspan="1"
                                                    tabindex="0">
                                                    版本id
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Browser: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1" tabindex="0">
                                                    声明内容
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="Platform(s): activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">
                                                    是否启用
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="CSS grade: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">修改
                                                </th>
                                                <th aria-controls="example2"
                                                    aria-label="CSS grade: activate to sort column ascending"
                                                    class="sorting" colspan="1"
                                                    rowspan="1"
                                                    tabindex="0">删除
                                                </th>
                                            </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                    <!-- /.box-body -->
                                </div>
                                <!-- /.box -->
                            </div>
                            <!-- /.col -->
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Main Footer -->
    <footer class="main-footer">
        <!-- To the right -->
        <div class="pull-right hidden-xs">
            老师分给高点，我给你磕头了，砰砰砰！
        </div>
        <!-- Default to the left -->
        <strong>Copyright &copy; 2020 <a href="#">能力有限公司</a>.</strong> 版权所有.
    </footer>
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<div class="containter" th:each="sysInfo:${sysInfos}">
    <div class="modal model-danger fade in" style="display: none; padding-right: 17px;"
         th:id="'removeModal' + ${sysInfo.getId()}">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myRemoveModalLabel">警告</h4>
                </div>
                <div class="modal-body">
                    你确定要删除吗？
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal" type="button">我再想想</button>
                    <a class="btn btn-danger"
                       th:href="@{/admin/removeSysInfo/{id}(id=${sysInfo.getId()})}"
                       type="button">没错，我要删除</a>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
</div>
<div class="containter" th:each="sysInfo:${sysInfos}">
    <div class="modal model-danger fade in" style="display: none; padding-right: 17px;"
         th:id="'updateModal' + ${sysInfo.getId()}">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myUpdateModalLabel">修改</h4>
                </div>
                <div class="modal-body">
                    <form th:action="@{/admin/updateSysInfo/{id}(id=${sysInfo.getId()})}">
                        <div class="form-group">
                            <label for="noteOfDutyFreeUpdate">使用前必读</label>
                            <textarea class="form-control" id="noteOfDutyFreeUpdate" name="noteOfDutyFreeUpdate"
                                      placeholder="使用前必读" rows="3"
                                      style="resize:none;" th:placeholder="${sysInfo.getNoteOfDutyFree()}"></textarea>
                        </div>
                        <hr>
                        <button class="btn bg-maroon margin" type="submit">提交</button>
                    </form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
</div>


<!-- REQUIRED JS SCRIPTS -->
<!-- AdminLTE App -->
<script src="/static/js/app.js"></script>
</body>
<!-- Add Modal -->
<div aria-labelledby="myModalLabel" class="modal fade" id="addModal" role="dialog" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">新增使用前必读</h4>
            </div>
            <div class="modal-body">
                <form action="/admin/saveNewSysInfo" method="post">
                    <div class="form-group">
                        <label for="noteOfDutyFree">内容</label>
                        <textarea class="form-control" id="noteOfDutyFree" name="noteOfDutyFree" placeholder="内容"
                                  rows="3" style="resize:none;"></textarea>
                    </div>
                    <button class="btn bg-navy center-block" type="submit">增加</button>
                </form>
            </div>
        </div>
    </div>
</div>

</html>
